Courses / C++ Learning / Data Types
C++ Data Types
Mark as CompletePick the right type for speed, memory, and clarity.
Common Types
intfor whole numbersdoublefor decimalscharfor a single characterboolfor true/falsestd::stringfor text
Key takeaway: choose the smallest type that fits.
Example
#include <string>
int score = 95;
double pi = 3.14;
char letter = 'B';
bool is_ready = true;
std::string name = "Ali";
Ready to try it yourself?
Define a few variables with different types.
← Variables
Functions →